package at.fhj.itm10.ticketmaster.entities;

import java.util.Date;

/**
 * @author 	Kevin Reinmueller 
 * @since	November 2012
 */

public class Order implements Entity {

	private long id;
	private long fk_customer_id;
	private Date order_date;
	private Date payment_date;
	private boolean is_paid;

	public Order(long fk_customer_id, Date order_date, Date payment_date, boolean is_paid) {
		this.setFk_customer_id(fk_customer_id);
		this.setOrder_date(order_date);
		this.setPayment_date(payment_date);
		this.setIs_paid(is_paid);		
	}
	
	public Order() {
		// empty Constructor
	}

	public long getFk_customer_id() {
		return fk_customer_id;
	}

	public void setFk_customer_id(long fk_customer_id) {
		this.fk_customer_id = fk_customer_id;
	}

	public Date getOrder_date() {
		return order_date;
	}

	public void setOrder_date(Date order_date2) {
		this.order_date = order_date2;
	}

	public Date getPayment_date() {
		return payment_date;
	}

	public void setPayment_date(Date payment_date) {
		this.payment_date = payment_date;
	}

	public boolean isIs_paid() {
		return is_paid;
	}

	public void setIs_paid(boolean is_paid) {
		this.is_paid = is_paid;
	}

	public long getId() {
		return this.id;
	}

	public void setId(long id) {
		this.id = id;
	}
	
	@Override
	public String toString() {
		return "Order [id=" + id + ", fk_customer_id=" + fk_customer_id
				+ ", order_date=" + order_date + ", payment_date="
				+ payment_date + ", is_paid=" + is_paid + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (int) (id ^ (id >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Order other = (Order) obj;
		if (id != other.id)
			return false;
		return true;
	}

}
